﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <script src="~/lib/jquery/dist/jquery.js"></script>
</head>
<body>
    <form method="post" action="/Default/Index">
        <input type="text" value="" name="uname" id="uname" />
        <button type="submit">提交</button>
    </form>

    <script type="text/javascript">
        $(()=>{
            //$("button").click(function(){
            //    $("form").submit();
            //});

            $("form").submit(function(){

                let a = 1;

                $.ajax({
                    url:'',
                    type:"",
                    async:true,
                    data:{},
                    contentType:'',
                    dataType:'',
                    done:function(e){

                    },
                    success:function(e){
                        a = 2;
                    }
                })

                console.log(a);

                return false;
            })
        });    
    </script>
</body>
</html>
